Typed Adapton:
نویسندگان
چکیده
Nominal memoization combines memoized functional programming with a controlled form of imperative cache effects. By leveraging these imperative effects, nominal memoization can dramatically outperform traditional (“structural”) memoization. However, the nominal memoization programming model is error-prone: when the programmer unintentionally misuses names, their incremental program ceases to correspond to its purely functional semantics. This paper develops a refinement type system for nominal memoization that enforces a program’s correspondence with its purely functional semantics. Our type system employs set-indexed types in the style of DML (Xi and Pfenning 1999), extended with polymorphism over kinds and index functions. We prove that our type system enforces the dynamic side conditions required by Hammer et al. (2015). Past work shows that these conditions suffice for realistic uses of nominal memoization while also guaranteeing from-scratch consistency of the incremental programs. Furthermore, we propose a decidable form of name-level computations for expressing generic naming strategies in type-generic incremental code.
منابع مشابه
miniAdapton: A Minimal Implementation of Incremental Computation in Scheme
We describe a complete Scheme implementation of miniAdapton, which implements the core functionality of the Adapton system for incremental computation (also known as self-adjusting computation). Like Adapton, miniAdapton allows programmers to safely combine mutation and memoization. miniAdapton is built on top of an even simpler system, microAdapton. Both miniAdapton and microAdapton are design...
متن کاملADAPTON: Composable, Demand- Driven Incremental Computation
Many researchers have proposed programming languages that support incremental computation (IC), which allows programs to be efficiently re-executed after a small change to the input. However, existing implementations of such languages have two important drawbacks. First, recomputation is oblivious to specific demands on the program output; that is, if a program input changes, all dependencies w...
متن کاملTyped Adapton: Refinement types for nominal memoization
Nominal memoization combines memoized functional programming with a controlled form of imperative cache effects. By leveraging these imperative effects, nominal memoization can dramatically outperform traditional (“structural”) memoization. However, the nominal memoization programming model is error-prone: when the programmer unintentionally misuses names, their incremental program ceases to co...
متن کاملA DAPTON : Composable , Demand - Driven Incremental Computation ( Extended
Many researchers have proposed programming languages that support incremental computation (IC), which allows programs to be efficiently re-executed after a small change to the input. However, existing implementations of such languages have two important drawbacks. First, recomputation is oblivious to specific demands on the program output; that is, if a program input changes, all dependencies w...
متن کاملComposable, Demand-Driven Incremental Computation
Many researchers have proposed programming languages that support incremental computation (IC), which allows programs to be efficiently re-executed after a small change to the input. However, existing implementations of such languages have two important drawbacks. First, recomputation is oblivious to specific demands on the program output; that is, if a program input changes, all dependencies w...
متن کامل